<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //创建类class，创建一个明星类
        class star {
            //类的共有属性放在constructor
            constructor(uname,age){
                this.uname = uname;
                this.age = age;
            }

            //创建方法
            sing(sing){
                // console.log("唱歌");
                console.log(this.uname + sing);
            }
        }

        //利用类创建对象 new
        var tkx = new star("谭坤新",22);
        console.log(tkx);
        tkx.sing("小跳蛙");
    </script>
    <script src="./jquery-3.5.1.min.js"></script>
</body>
</html>